A device is described in JP 2001280215 A which has a valve needle and a shape memory element that, by the application of a controllable magnetic field, carries out a control stroke travel that operates the valve needle, and a coil that excites the magnetic field, which is situated in a magnet housing which is limited at its end face with respect to its actuating axis by a front wall, in each case, the two front walls having a through opening within the coil. The control stroke travel is achieved by the shortening of the shape memory element in the direction of a actuating axis of the valve needle. The disadvantage is that, because of the selected positioning of metallic elements and air gaps, the magnetic field excited around the electric coil develops at most a slight magnetic field in the shape memory element. The shape memory element has a magnetic field flowing through it, in the direction of its longitudinal extension, if at all. Since the shape memory element has a high magnetic resistance and is developed to be very long in the axial direction, only a very weak magnetic field can be induced in the shape memory element. In response to the magnetic field that is weak at most, the shape memory element can generate only a very slight lift of the valve needle. In addition, the mechanical stress condition is unfavorable in response to applying the magnetic field in a cylindrically developed shape memory element. This stands in the way of lift development.